var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2ExcelManager = require("ExcelManager");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_Kapai = /* */function (_cc$Component41) {
  babel_inherits(l, _cc$Component41);
  var _super45 = babel_createSuper(l);
  function l() {
    var _this98;
    babel_classCallCheck(this, l);
    _this98 = _super45.apply(this, arguments);
    _this98.type = 1;
    _this98.jianguo = [];
    _this98.speed = 300;
    _this98.blq_zaxiang = [];
    return _this98;
  }
  babel_createClass(l, [{
    key: "onLoad",
    value: function onLoad() {
      this.blq_zaxiang = $2ExcelManager.ExcelMgr.instance.GetExcelObject($2ExcelManager.TableName.blq_zaxiang);
      this.speed = this.blq_zaxiang[1].val;
      this.init(this.type);
    }
  }, {
    key: "init",
    value: function init(e) {
      this.type = e;
      this.node.getChildByName("jianguo").getComponent(cc.Sprite).spriteFrame = 1 === e ? this.jianguo[0] : 2 === e ? this.jianguo[1] : this.jianguo[0];
    }
  }, {
    key: "move",
    value: function move(e) {
      this.node.x -= e * this.speed;
      this.node.x < -this.node.parent.width / 2 + this.node.width / 2 + 20 && (this.speed = 0);
    }
  }, {
    key: "update",
    value: function update(e) {
      this.move(e);
    }
  }]);
  return l;
}(cc.Component);
cc__decorate([ccp_property], def_Kapai.prototype, "type", undefined);
cc__decorate([ccp_property([cc.SpriteFrame])], def_Kapai.prototype, "jianguo", undefined);
def_Kapai = cc__decorate([ccp_ccclass], def_Kapai);
exports.default = def_Kapai;